package 线程基本使用;
class CountOperate extends Thread
{
	public CountOperate()
	{
		 System.out.println("CountOperate--begin");
		 System.out.println("currentThread().getName()="+currentThread().getName());
		 System.out.println("this.getName()="+this.getName());
		 System.out.println("CountOperate--end");
	}
	public void run()
	{
		System.out.println("run--begin");
		 System.out.println("currentThread().getName()="+Thread.currentThread().getName());
		 System.out.println("this.getName()="+this.getName());
		 System.out.println("run--end");

	}
}
public class Test1_22_1 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		CountOperate a=new CountOperate();
		a.setName("A");
		a.start();//将整个对象线程名称变为"A";
		/*Thread t1=new Thread(a);
		t1.setName("A");//run线程名称改为"A"
		t1.start();*/

	}

}
